package com.tiancheng.trade.merchant.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tiancheng.trade.merchant.mapper.MerchantPayRegFileMapper;
import com.tiancheng.trade.merchant.model.MerchantPayRegFile;
import com.tiancheng.trade.merchant.service.IMerchantPayRegFileService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @Author: kellen
 * @Description: 商户进件文件
 * @Date: create in 2024/11/19 17:48
 */
@Service
public class MerchantPayRegFileServiceImpl extends ServiceImpl<MerchantPayRegFileMapper, MerchantPayRegFile> implements IMerchantPayRegFileService {

    @Override
    public List<MerchantPayRegFile> queryByMerchantAndPayChannel(String merchantCode, Long orgPaymentChannelId) {
        return this.list(new LambdaQueryWrapper<MerchantPayRegFile>().eq(MerchantPayRegFile::getOrgPaymentChannelId,orgPaymentChannelId));
    }

    @Override
    public List<MerchantPayRegFile> queryByFileIds(List<String> fileIds) {
        if(CollectionUtils.isEmpty(fileIds)){
            return Collections.emptyList();
        }
        return this.list(new LambdaQueryWrapper<MerchantPayRegFile>().in(MerchantPayRegFile::getFileId,fileIds));
    }

    @Override
    public List<MerchantPayRegFile> queryByIds(List<String> fileIds) {
        if(CollectionUtils.isEmpty(fileIds)){
            return Collections.emptyList();
        }
        return this.list(new LambdaQueryWrapper<MerchantPayRegFile>().in(MerchantPayRegFile::getId,fileIds));
    }
}
